#ifndef _CONFIG_H_
#define _CONFIG_H_

#include <string.h>
#include <stdlib.h>
#include "stm8s_clk.h"
#include "stm8s_uart1.h"
#include "stm8s_flash.h"
#include "stm8s_gpio.h"

#define LED_PORT GPIOD
#define LED_PIN GPIO_PIN_3
#define LED_INIT GPIO_Init(LED_PORT, LED_PIN, GPIO_MODE_OUT_PP_LOW_FAST)
//#define LED_ON GPIO_WriteLow(LED_PORT, LED_PIN)
//#define LED_OFF GPIO_WriteHigh(LED_PORT, LED_PIN)
#define LED_ON __asm("LD A, #0X08\n""CPL A\n""LDW X, #0x500F\n""AND A, (X)\n""LD (X), A\n")
#define LED_OFF __asm("LD A, #0X08\n""LDW X, #0x500F\n""LD 0X00, A\n""LD A, (X)\n""OR A, 0X00\n""LD (X), A\n")
extern u32 loopCount;
void delay(); 


#define TEST_CH 0

#endif
